/*/////////////////////////////////////////////////////////////////////////////////
/// An
///    ___   ____ ___ _____ ___  ____
///   / _ \ / ___|_ _|_   _/ _ \|  _ \
///  | | | | |  _ | |  | || | | | |_) |
///  | |_| | |_| || |  | || |_| |  _ <
///   \___/ \____|___| |_| \___/|_| \_\
///                              File
///
/// Copyright (c) 2008-2009 Ismail TARIM <ismail@royalspor.com> and the Ogitor Team
//
//This program is free software; you can redistribute it and/or modify it under
//the terms of the GNU Lesser General Public License as published by the Free Software
//Foundation; either version 2 of the License, or (at your option) any later
//version.
//
//This program is distributed in the hope that it will be useful, but WITHOUT
//ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
//FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
//
//You should have received a copy of the GNU Lesser General Public License along with
//this program; if not, write to the Free Software Foundation, Inc., 59 Temple
//Place - Suite 330, Boston, MA 02111-1307, USA, or go to
//http://www.gnu.org/copyleft/lesser.txt.
////////////////////////////////////////////////////////////////////////////////*/

#pragma once

namespace Ogitors
{

class OgitorExport CMarkerEditor: public CNodeEditor
{
    friend class CMarkerEditorFactory;
public:
    /// Returns the Factory associated with this object
	static CBaseEditorFactory *getFactory();
    /// Returns the Factory associated with this object can be overridden
	virtual CBaseEditorFactory *getFactoryDynamic();

    void              setColour(const Ogre::ColourValue& colour, bool display);
    Ogre::ColourValue getColour();
    /// Virtual Function that loads (Creates) underlying object 
    virtual bool      load();
    /// Virtual Function that unloads (Deletes) underlying object 
    virtual bool      unLoad();
    virtual void      processParameters(Ogre::NameValuePairList &params);

    virtual bool	  setupPropertiesWnd(bool present);
    virtual void      getObjectProperties(Ogre::NameValuePairList &retList);
    virtual void      showBoundingBox(bool bShow);
  	virtual bool      handleCustomFunction(int BIND_ID, Ogre::String val);
    /// Overridden by Editor Objects to Import Object Dependant Properties
    virtual void      restore(Ogre::NameValuePairList &retList);
    virtual Ogre::AxisAlignedBox getAABB() {if(m_MarkerHandle) return m_MarkerHandle->getBoundingBox();else return Ogre::AxisAlignedBox::BOX_NULL;};

protected:
    Ogre::Entity      *m_MarkerHandle;
	Ogre::ColourValue  m_Colour;
    Ogre::MaterialPtr  m_Material;

	CMarkerEditor();
	virtual                ~CMarkerEditor() {};
};

class OgitorExport CMarkerEditorFactory: public CBaseEditorFactory
{
public:
  CMarkerEditorFactory();
  virtual ~CMarkerEditorFactory() {};
  virtual void Init();
  virtual CBaseEditor *CreateObject(CBaseEditor **parent, Ogre::NameValuePairList &params);
  virtual Ogre::String GetPlaceHolderName() {return "scbMarker.mesh";};
};
}
